<!DOCTYPE html> 
<html> 

<head>
        <meta name="layout" content="mobile">
	<title>HealthThink</title> 
	
</head> 

<body> 
  
  <div id="register">
    <h3 text-align="center">Register New Facility</h3>
    <p>*=Required Field</p>
  </div>
  
  <div class="ui-body ui-body-b">
    <g:hasErrors>
      <div class="errors">
        <font color="red">Errors on Input</font>
        <g:renderErrors bean="${facility}" as="list" />
      </div>
    </g:hasErrors>
  </div>
  
  <div class="ui-body ui-body-b">
    <div data-role="fieldcontain">
      <g:form action="register">
        <label for="name">Facility Name*:</label>
        <input type="text" name="name" id="name" value="${facility?.name}"  />

        <label for="latitude">Latitude*:</label>
        <input type="number" name="latitude" id="latitude" value="${facility?.latitude}"  />

        <label for="longitude">Longitude*:</label>
        <input type="number" name="longitude" id="longitude" value="${facility?.longitude}"  />
        
        <dt>Facility Type*:  </dt>
        <g:select name="facilityType" id="facilityType" from="${['Hospital','Emergency', 'Clinic', 'Family']}"
                value="${facility?.facilityType}"></g:select>
        
        <label for="address1">Address 1*:</label>
        <input type="text" name="primaryAddress.address" id="address1" value="${facility?.primaryAddress?.address}"  />
        
        <label for="address2">Address 2:</label>
        <input type="text" name="primaryAddress.address2" id="address2" value="${facility?.primaryAddress?.address2}"  />
        
        <label for="lga">LGA*:</label>
        <input type="text" name="primaryAddress.lga" id="lga" value="${facility?.primaryAddress?.lga}"  />
        
        <label for="state">State*:</label>
        <input type="text" name="primaryAddress.state" id="state" value="${facility?.primaryAddress?.state}"  />
        
        <label for="number">Phone Number:</label>
	<input type="tel" name="number" id="number" value="${telephoneNumber?.number}" />
        
        <g:select name="phoneType" id="phoneType" from="${['Fax', 'Home', 'Work', 'Cell']}"
                      value="${telephoneNumber?.phoneType}"></g:select>
        
        <dt>Graphic Location:  </dt>
        <g:textArea name="facilitySite.graphicLocation" value="${facility?.facilitySite?.graphicLocation}" width="1000px" height="1000px"/>
        
        <dt>Mission Statement:  </dt>
        <g:textArea name="facilitySite.missionStatement" value="${facility?.facilitySite?.missionStatement}" width="1000px" height="1000px"/>
        
        <dt>Summary:  </dt>
        <g:textArea name="facilitySite.detail" value="${facility?.facilitySite?.detail}" width="1000px" height="1000px" />

        <dt>In Operation:  <g:checkBox name="isInOperation" value="${isInOperation}" checked="true"/><dt>
        </br>
        
        <g:submitButton name="register" value="Register"/>
      </g:form>
    </div>
  </div>


</body>
</html>
